package com.qingcloud.adminbackend.entity.sysorg;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.qingcloud.adminbackend.entity.sysfunction.ModuleDTO;
import com.qingcloud.adminbackend.entity.sysfunction.SysFunction;
import com.qingcloud.adminbackend.entity.user.SysUser;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.util.*;

/**
 * <p>
 * 客户表
 * </p>
 *
 * @author liyuhong
 * @since 2018-11-15
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("sys_org")
public class SysOrg extends Model {

    private static final long serialVersionUID = 1L;

    /**
     * 组织Id
     */
    private String id;

    /**
     * 组织名称
     */
    @ApiModelProperty(value = "组织名称", example = "成都市环境保护局")
    @TableField(value = "`name`")
    private String name;

    /**
     * 企业简称
     */
    @ApiModelProperty(value = "企业简称", example = "成都环保局")
    private String shortName;

    /**
     * 企业全称
     */
    @ApiModelProperty(value = "企业全称", example = "成都市环境保护局")
    private String fullName;

    /**
     * 位置
     */
    @ApiModelProperty(value = "位置", example = "")
    private String position;

    /**
     * logo
     */
    @ApiModelProperty(value = "logo横版", example = "")
    private String logo1;

    @ApiModelProperty(value = "logo正方形", example = "")
    private String logo2;

    @TableField(exist = false)
    @ApiModelProperty(value = "业务种类图标", example = "")
    private List<SysOrgLogoDTO> businessLogoList;

    /**
     * 父组织
     */
    @ApiModelProperty(value = "父组织", example = "")
    private String parentId;

    /**
     * 类型1：政府；2：企业;3:机构;4:其他
     */
    @ApiModelProperty(value = "类型1：政府；2：企业;3:机构;4:其他", example = "1")
    @TableField(value = "`type`")
    private Integer type;

    /**
     * 1:客户 2:分支机构
     */
    @ApiModelProperty(value = "1:客户 2:分支机构", example = "1")
    private int category;

    /**
     * 描述
     */
    @ApiModelProperty(value = "描述", example = "")
    private String description;


    /**
     * 0:未删除 1:已删除
     */
    @ApiModelProperty(value = "0:未删除 1:已删除", example = "0")
    private Integer deleteFlag;

    @ApiModelProperty(value = "创建时间")
    private Date createDt;

    @ApiModelProperty(value = "创建人")
    private String createBy;

    @ApiModelProperty(value = "修改时间")
    private Date modifyDt;

    @ApiModelProperty(value = "修改人")
    private String modifyBy;

    @ApiModelProperty(value = "1：网格化，2:健康云", example = "0")
    private String businessType;

    @ApiModelProperty(value = "子机构")
    @TableField(exist = false)
    private List<SysOrg> childSysOrgs = Collections.EMPTY_LIST;

    @ApiModelProperty(value = "功能集合")
    @TableField(exist = false)
    private List<SysFunction> functions;

    @ApiModelProperty(value = "功能Ids")
    @TableField(exist = false)
    private Set<String> functionIds;

    @ApiModelProperty(value = "订单绑定的功能Ids")
    @TableField(exist = false)
    private Set<String> orderFunctionIds;

    @ApiModelProperty(value = "模块集合")
    @TableField(exist = false)
    private Set<ModuleDTO> moduleDTOs;

    @ApiModelProperty(value = "模块集合Ids")
    @TableField(exist = false)
    private List<String> moduleIds;

    @ApiModelProperty(value = "订单绑定的模块Ids")
    @TableField(exist = false)
    private Set<String> orderModuleIds;

    @ApiModelProperty(value = "父组织名称")
    @TableField(exist = false)
    private String parentName;

    @ApiModelProperty(value = "管理员")
    @TableField(exist = false)
    private SysUser user;

    @ApiModelProperty(value = "订单id")
    @TableField(exist = false)
    private Set<String> orderIds = new HashSet<>();

    @ApiModelProperty(value = "可写")
    @TableField(exist = false)
    private Integer manage = 0;
    @ApiModelProperty(value = "可读")
    @TableField(exist = false)
    private Integer read = 0;

}
